package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qf.mapper.DtsCartMapper;
import com.qf.pojo.DtsCart;
import com.qf.service.DtsCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author wanghaotian
 * time:2022/12/21,0021 11:40
 * description:
 */

@Service
public class DtsCartServiceImpl implements DtsCartService {

    @Autowired
    private DtsCartMapper cartMapper;

    @Override
    public int findByGoodsId(Integer id) {
        LambdaQueryWrapper<DtsCart> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(DtsCart::getGoodsId,id);
        wrapper.eq(DtsCart::getDeleted,false);
        Integer count = cartMapper.selectCount(wrapper);
        return count;
    }
}
